<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWyTicketOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wy_ticket_order', function (Blueprint $table) {
            $table->increments('id');
            $table->bigInteger('uuid')->index('uuid')->comment('订单编号：11位，B+年(后两位)+月+日+序号 如：B171005001');
            $table->string('name', 50)->comment('用户真实姓名');
            $table->string('mobile', 20)->comment('用户提交预约时所留的手机号');
            $table->string('houses_name', 20)->comment('楼盘名称');
            $table->string('covered_area', 20)->comment('建筑面积');
            $table->string('life_style', 20)->comment('生活方式');
            $table->string('houses_model', 20)->comment('房子户型');
            $table->decimal('trade_cash', 10, 2)->default(0)->comment('交易金额（status=4时设置）');
            $table->integer('user_id')->default(0)->comment('若不是会员为0，是会员则是会员id');
            $table->integer('referrer_id')->default(0)->comment('推荐人Id');
            $table->integer('merchant_id')->default(0)->comment('门店id');
            $table->tinyInteger('status')->comment('订单处理状态 0待处理，1已预约，2已量尺，3已出方案4.已成交5.已安装');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wy_ticket_order');
    }
}
